<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浏览器测试页面</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            margin: 0;
            padding: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .container {
            background: white;
            padding: 40px;
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.1);
            text-align: center;
            max-width: 600px;
        }
        h1 {
            color: #333;
            margin-bottom: 20px;
        }
        .status {
            background: #f6ffed;
            border: 1px solid #b7eb8f;
            border-radius: 6px;
            padding: 15px;
            margin: 20px 0;
        }
        .status p {
            margin: 5px 0;
            color: #52c41a;
        }
        button {
            background: #1890ff;
            color: white;
            border: none;
            padding: 12px 24px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 16px;
            margin: 10px;
        }
        button:hover {
            background: #40a9ff;
        }
        .info {
            background: #f0f2f5;
            padding: 15px;
            border-radius: 6px;
            margin-top: 20px;
            text-align: left;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>🔍 浏览器功能测试</h1>
        <p>这是一个静态HTML页面，用于测试浏览器基本功能</p>
        
        <div class="status">
            <p>✅ HTML 渲染正常</p>
            <p>✅ CSS 样式正常</p>
            <p id="js-status">⏳ JavaScript 检测中...</p>
        </div>
        
        <button onclick="testInteraction()">测试交互功能</button>
        <button onclick="testLocalStorage()">测试本地存储</button>
        <button onclick="testConsole()">测试控制台</button>
        
        <div class="info">
            <h3>浏览器信息:</h3>
            <p><strong>User Agent:</strong> <span id="user-agent"></span></p>
            <p><strong>当前时间:</strong> <span id="current-time"></span></p>
            <p><strong>页面URL:</strong> <span id="page-url"></span></p>
            <p><strong>本地存储支持:</strong> <span id="storage-support"></span></p>
        </div>
        
        <div style="margin-top: 20px;">
            <a href="/" style="color: #1890ff; text-decoration: none;">← 返回React应用</a>
        </div>
    </div>
    
    <script>
        // 测试JavaScript基本功能
        document.addEventListener('DOMContentLoaded', function() {
            // 更新JavaScript状态
            document.getElementById('js-status').innerHTML = '✅ JavaScript 执行正常';
            document.getElementById('js-status').style.color = '#52c41a';
            
            // 填充浏览器信息
            document.getElementById('user-agent').textContent = navigator.userAgent;
            document.getElementById('current-time').textContent = new Date().toLocaleString();
            document.getElementById('page-url').textContent = window.location.href;
            document.getElementById('storage-support').textContent = typeof(Storage) !== "undefined" ? '支持' : '不支持';
            
            console.log('浏览器测试页面加载完成');
        });
        
        function testInteraction() {
            alert('交互功能正常！点击事件可以正常触发。');
            console.log('交互测试完成');
        }
        
        function testLocalStorage() {
            try {
                localStorage.setItem('test-key', 'test-value');
                const value = localStorage.getItem('test-key');
                localStorage.removeItem('test-key');
                alert('本地存储功能正常！测试值: ' + value);
                console.log('本地存储测试完成');
            } catch (e) {
                alert('本地存储功能异常: ' + e.message);
                console.error('本地存储测试失败:', e);
            }
        }
        
        function testConsole() {
            console.log('这是一条测试日志');
            console.warn('这是一条测试警告');
            console.error('这是一条测试错误（仅用于测试）');
            alert('已向控制台输出测试信息，请打开开发者工具查看');
        }
    </script>
</body>
</html>